It is often quite hard to distinguish between scope and linkage, and the roles they play. This article focuses on scope and linkage, and how they are used in C language.
Note: All C programs have been compiled on 64 bit GCC 4.9.2. Also, the terms “identifier” and “name” have been used interchangeably in this article....
Given a number A. The task is to check whether A is positive, negative or zero. Examples:...
C getchar is a standard library function that takes a single input character from standard input. The major difference between getchar and getc is that getc can take input from any no of input streams but getchar can take input from a single standard input stream....
An array is a data structure that stores a collection of elements, all of the same data type, in a contiguous block of memory. Each element in the array is identified by an index, which is a numerical value that represents the position of the element in the array. The first element in the array has an index of 0, the second element has an index of 1, and so on....
Given a singly linked list, sort it using bubble sort by swapping nodes....
Given two strings, the task is to check if these two strings are identical(same) or not....
In this article, we will look at what happened when we exceed the valid range of built-in data types in C++ with some examples....
For Prerequisite : Loops, If Else Statement1. Hollow pyramid/triangle pattern The pattern is similar to pyramid pattern. The only difference is, we will replace all internal ‘#’ or ‘*’ characters by space character and we will print 2*N-1 (N = number of rows in pattern) ‘#’ or ‘*’ characters in last row. Examples:...
In the C programming language (after the C99 standard), a new keyword is introduced known as restrict....
An array in C is a fixed-size homogeneous collection of elements stored at a contiguous memory location. It is a derived data type in C that can store elements of different data types such as int, char, struct, etc. It is one of the most popular data types widely used by programmers to solve different problems not only in C but also in other languages....
If we have a function in base class and another function with the same name in derived class, can the base class function be called from derived class object? This is an interesting question and as an experiment, predict the output of the following C++ program:...